use std::net::{UdpSocket, SocketAddr};
use std::str::FromStr;

pub(crate) fn test_udp(){

    let socket = UdpSocket::bind("0.0.0.0:0").expect("构建失败");

    let target = SocketAddr::from_str("106.55.184.199:123").unwrap();
    println!("发送了，等待接收");
    socket.send_to("".as_bytes(),&target).unwrap();

    let mut buffer:[u8; 1024] = [0; 1024];
    let result = socket.recv(&mut buffer).unwrap();

    println!("result: {}, buffer: {:?}", result, buffer);
}






